<template>
    <div>

sports   ---{{$route.params.id}}----------{{$route.params.name}}

<button  @click="goBooks">点击跳转到books页面</button>

<button  @click="goBooksQuery">点击跳转到books页面222  问号传参</button>

    </div>
</template>

<script>
export default {
    data() {
        return {

        };
    },
    created() {

    },
    mounted() {
        console.log(this.$route.params)

    },
    methods: {


//         // 命名的路由
// router.push({ name: 'user', params: { userId: '123' }})

// // 带查询参数，变成 /register?plan=private
// router.push({ path: 'register', query: { plan: 'private' }})
        goBooks() {
            let   myparams= {id:1684231010510325817}

            // 编程式路由 
            this.$router.push( {name:'books',params:myparams})
              
        },
        goBooksQuery() {
             let   myparams= {id:1684231010510325817,name:'zs'}
              this.$router.push( {path:'/books',query:myparams})
        }


    }
};
</script>

<style scoped   lang='css'>

</style>
